Method and Apparatus for Multiple Hypothesis Prediction in Video Coding System

ABSTRACT

A method and apparatus for predictive coding. According to the method, combined prediction members are determined, where each of the combined prediction member includes a weighted sum of a first prediction candidate and a second prediction candidate using a target weighting selected from a weighting set. Boundary matching costs associated with the combined prediction members are determined, where each of the boundary matching costs is determined, for the combined prediction member with the target weighting, by using predicted samples of the current block based on the combined prediction member with the target weighting and neighbouring reconstructed samples of the current block. The current block is then encoded or decoded using a final combined prediction decided based on at least one of the boundary matching costs.

CROSS REFERENCE TO RELATED APPLICATIONS

The present invention is a non-Provisional Application of and claims priority to U.S. Provisional Patent Application No. 63/294,424 filed on Dec. 29, 2021. The U.S. Provisional Patent Application is hereby incorporated by reference in its entirety.

FIELD OF THE INVENTION

The present invention relates to video coding system. In particular, the present invention relates to predictive coding using multiple hypothesis.

BACKGROUND

Versatile video coding (VVC) is the latest international video coding standard developed by the Joint Video Experts Team (JVET) of the ITU-T Video Coding Experts Group (VCEG) and the ISO/IEC Moving Picture Experts Group (MPEG). The standard has been published as an ISO standard: ISO/IEC 23090-3:2021, Information technology—Coded representation of immersive media—Part 3: Versatile video coding, published Feb. 2021. VVC is developed based on its predecessor HEVC (High Efficiency Video Coding) by adding more coding tools to improve coding efficiency and also to handle various types of video sources including 3-dimensional (3D) video signals.

FIG. 1A illustrates an exemplary adaptive Inter/Intra video coding system incorporating loop processing. For Intra Prediction, the prediction data is derived based on previously coded video data in the current picture. For Inter Prediction 112, Motion Estimation (ME) is performed at the encoder side and Motion Compensation (MC) is performed based of the result of ME to provide prediction data derived from other picture(s) and motion data. Switch 114 selects Intra Prediction 110 or Inter-Prediction 112 and the selected prediction data is supplied to Adder 116 to form prediction errors, also called residues. The prediction error is then processed by Transform (T) 118 followed by Quantization (Q) 120. The transformed and quantized residues are then coded by Entropy Encoder 122 to be included in a video bitstream corresponding to the compressed video data. The bitstream associated with the transform coefficients is then packed with side information such as motion and coding modes associated with Intra prediction and Inter prediction, and other information such as parameters associated with loop filters applied to underlying image area. The side information associated with Intra Prediction 110, Inter prediction 112 and in-loop filter 130, are provided to Entropy Encoder 122 as shown in FIG. 1A. When an Inter-prediction mode is used, a reference picture or pictures have to be reconstructed at the encoder end as well. Consequently, the transformed and quantized residues are processed by Inverse Quantization (IQ) 124 and Inverse Transformation (IT) 126 to recover the residues. The residues are then added back to prediction data 136 at Reconstruction (REC) 128 to reconstruct video data. The reconstructed video data may be stored in Reference Picture Buffer 134 and used for prediction of other frames.

As shown in FIG. 1A, incoming video data undergoes a series of processing in the encoding system. The reconstructed video data from REC 128 may be subject to various impairments due to a series of processing. Accordingly, in-loop filter 130 is often applied to the reconstructed video data before the reconstructed video data are stored in the Reference Picture Buffer 134 in order to improve video quality. For example, deblocking filter (DF), Sample Adaptive Offset (SAO) and Adaptive Loop Filter (ALF) may be used. The loop filter information may need to be incorporated in the bitstream so that a decoder can properly recover the required information. Therefore, loop filter information is also provided to Entropy Encoder 122 for incorporation into the bitstream. In FIG. 1A, Loop filter 130 is applied to the reconstructed video before the reconstructed samples are stored in the reference picture buffer 134. The system in FIG. 1A is intended to illustrate an exemplary structure of a typical video encoder. It may correspond to the High Efficiency Video Coding (HEVC) system, VP8, VP9, H.264 or VVC.

The decoder, as shown in FIG. 1B, can use similar or portion of the same functional blocks as the encoder except for Transform 118 and Quantization 120 since the decoder only needs Inverse Quantization 124 and Inverse Transform 126. Instead of Entropy Encoder 122, the decoder uses an Entropy Decoder 140 to decode the video bitstream into quantized transform coefficients and needed coding information (e.g. ILPF information, Intra prediction information and Inter prediction information). The Intra prediction 150 at the decoder side does not need to perform the mode search. Instead, the decoder only needs to generate Intra prediction according to Intra prediction information received from the Entropy Decoder 140. Furthermore, for Inter prediction, the decoder only needs to perform motion compensation (MC 152) according to Inter prediction information received from the Entropy Decoder 140 without the need for motion estimation.

According to VVC, an input picture is partitioned into non-overlapped square block regions referred as CTUs (Coding Tree Units), similar to HEVC. Each CTU can be partitioned into one or multiple smaller size coding units (CUs). The resulting CU partitions can be in square or rectangular shapes. Also, VVC divides a CTU into prediction units (PUs) as a unit to apply prediction process, such as Inter prediction, Intra prediction, etc.

The VVC standard incorporates various new coding tools to further improve the coding efficiency over the HEVC standard. Among various new coding tools, some coding tools relevant to the present invention are reviewed as follows.

Inter Prediction Overview

According to JVET-T2002 Section 3.4. (Jianle Chen, et. al., “Algorithm description for Versatile Video Coding and Test Model 11 (VTM 11)”, Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29, 20th Meeting, by teleconference, 7-16 October 2020, Document: JVET-T2002)), for each inter-predicted CU, motion parameters consist of motion vectors, reference picture indices and reference picture list usage index, and additional information needed for the new coding feature of VVC to be used for inter-predicted sample generation. The motion parameter can be signalled in an explicit or implicit manner. When a CU is coded with skip mode, the CU is associated with one PU and has no significant residual coefficients, no coded motion vector delta or reference picture index. A merge mode is specified whereby the motion parameters for the current CU, which are obtained from neighbouring CUs, including spatial and temporal candidates, and additional schedules introduced in VVC. The merge mode can be applied to any inter-predicted CU, not only for skip mode. The alternative to the merge mode is the explicit transmission of motion parameters, where motion vector, corresponding reference picture index for each reference picture list and reference picture list usage flag and other needed information are signalled explicitly per each CU.

Beyond the inter coding features in HEVC, VVC includes a number of new and refined inter prediction coding tools listed as follows:

-   -   Extended merge prediction     -   Merge mode with MVD (MMVD)     -   Symmetric MVD (SMVD) signalling     -   Affine motion compensated prediction     -   Subblock-based temporal motion vector prediction (SbTMVP)     -   Adaptive motion vector resolution (AMVR)     -   Motion field storage: 1/16^(th) luma sample MV storage and 8×8         motion field compression     -   Bi-prediction with CU-level weight (BCW)     -   Bi-directional optical flow (BDOF)     -   Decoder side motion vector refinement (DMVR)     -   Geometric partitioning mode (GPM)     -   Combined inter and intra prediction (CIIP)

The following description provides the details of those inter prediction methods specified in VVC.

Extended Merge Prediction

In VVC, the merge candidate list is constructed by including the following five types of candidates in order:

1) Spatial MVP from spatial neighbour CUs

2) Temporal MVP from collocated CUs

3) History-based MVP from an FIFO table

4) Pairwise average MVP

5) Zero MVs.

The size of merge list is signalled in sequence parameter set (SPS) header and the maximum allowed size of merge list is 6. For each CU coded in the merge mode, an index of best merge candidate is encoded using truncated unary binarization (TU). The first bin of the merge index is coded with context and bypass coding is used for remaining bins.

The derivation process of each category of the merge candidates is provided in this session. As done in HEVC, VVC also supports parallel derivation of the merge candidate lists (or called as merging candidate lists) for all CUs within a certain size of area.

Spatial Candidate Derivation

The derivation of spatial merge candidates in VVC is the same as that in HEVC except that the positions of first two merge candidates are swapped. A maximum of four merge candidates (B₀, A₀, B₁ and A₁) for current CU 210 are selected among candidates located in the positions depicted in FIG. 2 . The order of derivation is B₀, A₀, B₁, A₁ and B₂. Position B₂ is considered only when one or more neighbouring CU of positions B₀, A₀, B₁, A₁ are not available (e.g. belonging to another slice or tile) or is intra coded. After candidate at position A₁ is added, the addition of the remaining candidates is subject to a redundancy check which ensures that candidates with the same motion information are excluded from the list so that coding efficiency is improved. To reduce computational complexity, not all possible candidate pairs are considered in the mentioned redundancy check. Instead, only the pairs linked with an arrow in FIG. 3 are considered and a candidate is only added to the list if the corresponding candidate used for redundancy check does not have the same motion information.

Temporal Candidates Derivation

In this step, only one candidate is added to the list. Particularly, in the derivation of this temporal merge candidate for a current CU 410, a scaled motion vector is derived based on the co-located CU 420 belonging to the collocated reference picture as shown in FIG. 4 . The reference picture list and the reference index to be used for the derivation of the co-located CU is explicitly signalled in the slice header. The scaled motion vector 430 for the temporal merge candidate is obtained as illustrated by the dotted line in FIG. 4 , which is scaled from the motion vector 440 of the co-located CU using the POC (Picture Order Count) distances, tb and td, where tb is defined to be the POC difference between the reference picture of the current picture and the current picture and td is defined to be the POC difference between the reference picture of the co-located picture and the co-located picture. The reference picture index of temporal merge candidate is set equal to zero.

The position for the temporal candidate is selected between candidates C₀ and C₁, as depicted in FIG. 5 . If CU at position C₀ is not available, is intra coded, or is outside of the current row of CTUs, position C₁ is used. Otherwise, position C₀ is used in the derivation of the temporal merge candidate.

History-Based Merge Candidates Derivation

The history-based MVP (HMVP) merge candidates are added to the merge list after the spatial MVP and TMVP. In this method, the motion information of a previously coded block is stored in a table and used as MVP for the current CU. The table with multiple HMVP candidates is maintained during the encoding/decoding process. The table is reset (emptied) when a new CTU row is encountered. Whenever there is a non-subblock inter-coded CU, the associated motion information is added to the last entry of the table as a new HMVP candidate.

The HMVP table size S is set to be 6, which indicates up to 5 History-based MVP (HMVP) candidates may be added to the table. When inserting a new motion candidate to the table, a constrained first-in-first-out (FIFO) rule is utilized where redundancy check is firstly applied to find whether there is an identical HMVP in the table. If found, the identical HMVP is removed from the table and all the HMVP candidates afterwards are moved forward, and the identical HMVP is inserted to the last entry of the table.

HMVP candidates could be used in the merge candidate list construction process. The latest several HMVP candidates in the table are checked in order and inserted to the candidate list after the TMVP candidate. Redundancy check is applied on the HMVP candidates to the spatial or temporal merge candidate.

To reduce the number of redundancy, check operations, the following simplifications are introduced:

-   -   1. The last two entries in the table are checked for redundancy         with respect to A₁and B₁ spatial candidates, respectively.     -   2. Once the total number of available merge candidates reaches         the maximally allowed merge candidates minus 1, the merge         candidate list construction process from HMVP is terminated.

Pair-Wise Average Merge Candidates Derivation

Pairwise average candidates are generated by averaging predefined pairs of candidates in the existing merge candidate list, using the first two merge candidates. The first merge candidate is defined as pOCand and the second merge candidate can be defined as plCand, respectively. The averaged motion vectors are calculated according to the availability of the motion vector of pOCand and plCand separately for each reference list. If both motion vectors are available in one list, these two motion vectors are averaged even when they point to different reference pictures, and its reference picture is set to the one of pOCand; if only one motion vector is available, use the one directly; and if no motion vector is available, keep this list invalid. Also, if the half-pel interpolation filter indices of pOCand and plCand are different, it is set to 0.

When the merge list is not full after pair-wise average merge candidates are added, the zero MVPs are inserted in the end until the maximum merge candidate number is encountered.

Merge Estimation Region

Merge estimation region (MER) allows independent derivation of merge candidate list for the CUs in the same merge estimation region (MER). A candidate block that is within the same MER as the current CU is not included for the generation of the merge candidate list of the current CU. In addition, the updating process for the history-based motion vector predictor candidate list is updated only if (xCb+cbWidth)»Log2ParMrgLevel is greater than xCb»Log2ParMrgLevel and (yCb+cbHeight)»Log2ParMrgLevel is great than (yCb»Log2ParMrgLevel), and where (xCb, yCb) is the top-left luma sample position of the current CU in the picture and (cbWidth, cbHeight) is the CU size. The MER size is selected at the encoder side and signalled as log2parallel_merge_level_minus2 in the Sequence Parameter Set (SPS).

Merge Mode with MVD (MMVD)

In addition to the merge mode, where the implicitly derived motion information is directly used for prediction samples generation of the current CU, the merge mode with motion vector differences (MMVD) is introduced in VVC. A MMVD flag is signalled right after sending a regular merge flag to specify whether MMVD mode is used for a CU.

In MMVD, after a merge candidate is selected, it is further refined by the signalled MVDs information. The further information includes a merge candidate flag, an index to specify motion magnitude, and an index for indication of motion direction. In MMVD mode, one for the first two candidates in the merge list is selected to be used as MV basis. The MMVD candidate flag is signalled to specify which one is used between the first and second merge candidates.

Distance index specifies motion magnitude information and indicates the pre-defined offset from the starting points (612 and 622) for a L0 reference block 610 and L1 reference block 620. As shown in FIG. 6 , an offset is added to either horizontal component or vertical component of the starting MV, where small circles in different styles correspond to different offsets from the centre. The relation of distance index and pre-defined offset is specified in Table 1.

TABLE 1 The relation of distance index and pre-defined offset Distance IDX 0 1 2 3 4 5 6 7 Offset (in unit of 1/4 1/2 1 2 4 8 16 32 luma sample)

Direction index represents the direction of the MVD relative to the starting point. The direction index can represent the four directions as shown in Table 2. It is noted that the meaning of MVD sign could be variant according to the information of starting MVs. When the starting MVs are an un-prediction MV or bi-prediction MVs with both lists pointing to the same side of the current picture (i.e. POCs of two references both larger than the POC of the current picture, or both smaller than the POC of the current picture), the sign in Table 2 specifies the sign of the MV offset added to the starting MV. When the starting MVs are bi-prediction MVs with the two MVs pointing to the different sides of the current picture (i.e. the POC of one reference larger than the POC of the current picture, and the POC of the other reference smaller than the POC of the current picture), and the difference of POC in list 0 is greater than the one in list 1, the sign in Table 2 specifies the sign of MV offset added to the list 0 MV component of the starting MV and the sign for the listl MV has an opposite value. Otherwise, if the difference of POC in list 1 is greater than list 0, the sign in Table 2 specifies the sign of the MV offset added to the listl MV component of starting MV and the sign for the list 0 MV has an opposite value.

The MVD is scaled according to the difference of POCs in each direction. If the differences of POCs in both lists are the same, no scaling is needed. Otherwise, if the difference of POC in list 0 is larger than the one in list 1, the MVD for list 1 is scaled, by defining the POC difference of L0 as td and POC difference of L1 as tb, described in FIG. 5 . If the POC difference of L1 is greater than LO, the MVD for list 0 is scaled in the same way. If the starting MV is uni-predicted, the MVD is added to the available MV.

TABLE 2 Sign of MV offset specified by direction index Direction IDX 00 01 10 11 x-axis + − N/A N/A y-axis N/A N/A + −

Affine Motion Compensated Prediction

In HEVC, only translation motion model is applied for motion compensation prediction (MCP). While in the real world, there are many kinds of motion, e.g. zoom in/out, rotation, perspective motions and the other irregular motions. In VVC, a block-based affine transform motion compensation prediction is applied. As shown FIGS. 7A-B, the affine motion field of the block 710 is described by motion information of two control point (4-parameter) in FIG. 7A or three control point motion vectors (6-parameter) in FIG. 7B.

For 4-parameter affine motion model, motion vector at sample location (x, y) in a block is derived as:

$\begin{matrix} \left\{ \begin{matrix} {{mv}_{x} = {{\frac{{mv}_{1x} - {mv}_{0x}}{W}x} + {\frac{{mv}_{1y} - {mv}_{0y}}{W}y} + {mv}_{0x}}} \\ {{mv}_{y} = {{\frac{{mv}_{1y} - {mv}_{0y}}{W}x} + {\frac{{mv}_{1y} - {mv}_{0x}}{W}y} + {mv}_{0y}}} \end{matrix} \right. & (1) \end{matrix}$

For 6-parameter affine motion model, motion vector at sample location (x, y) in a block is derived as:

$\begin{matrix} \left\{ \begin{matrix} {{mv}_{x} = {{\frac{{mv}_{1x} - {mv}_{0x}}{W}x} + {\frac{{mv}_{2x} - {mv}_{0x}}{H}y} + {mv}_{0x}}} \\ {{mv}_{y} = {{\frac{{mv}_{1y} - {mv}_{0y}}{W}x} + {\frac{{mv}_{2y} - {mv}_{0y}}{H}y} + {mv}_{0y}}} \end{matrix} \right. & (2) \end{matrix}$

Where (mv_(0x), mv_(0y)) is motion vector of the top-left corner control point, (mv_(1x), mv_(1y)) is motion vector of the top-right corner control point, and (mv₂,, mv_(2y)) is motion vector of the bottom-left corner control point.

In order to simplify the motion compensation prediction, block based affine transform prediction is applied. To derive motion vector of each 4×4 luma subblock, the motion vector of the centre sample of each subblock, as shown in FIG. 8 , is calculated according to above equations, and rounded to 1/16 fraction accuracy. Then, the motion compensation interpolation filters are applied to generate the prediction of each subblock with the derived motion vector. The subblock size of chroma-components is also set to be 4×4. The MV of a 4×4 chroma subblock is calculated as the average of the MVs of the top-left and bottom-right luma subblocks in the collocated 8×8 luma region.

As is for translational-motion inter prediction, there are also two affine motion inter prediction modes: affine merge mode and affine AMVP mode.

Affine Merge Prediction

AF_MERGE mode can be applied for CUs with both width and height larger than or equal to 8. In this mode, the CPMVs (Control Point MVs) of the current CU is generated based on the motion information of the spatial neighbouring CUs. There can be up to five CPMVP (CPMV Prediction) candidates and an index is signalled to indicate the one to be used for the current CU. The following three types of CPVM candidate are used to form the affine merge candidate list:

-   -   Inherited affine merge candidates that are extrapolated from the         CPMVs of the neighbour CUs     -   Constructed affine merge candidates CPMVPs that are derived         using the translational MVs of the neighbour CUs     -   Zero MVs

In VVC, there are two inherited affine candidates at most, which are derived from the affine motion model of the neighbouring blocks, one from left neighbouring CUs and one from above neighbouring CUs. The candidate blocks are the same as those shown in FIG. 2 . For the left predictor, the scan order is A₀−>A₁, and for the above predictor, the scan order is B0−>B₁−>B₂. Only the first inherited candidate from each side is selected. No pruning check is performed between two inherited candidates. When a neighbouring affine CU is identified, its control point motion vectors are used to derived the CPMVP candidate in the affine merge list of the current CU. As shown in FIG. 9 , if the neighbouring left bottom block A of the current block 910 is coded in affine mode, the motion vectors v₂ , v₃ and v₄ of the top left corner, above right corner and left bottom corner of the CU 920 containing block A are attained. When block A is coded with 4-parameter affine model, the two CPMVs of the current CU (i.e., v₀ and v₁) are calculated according to v₂, and v₃. In case that block A is coded with 6-parameter affine model, the three CPMVs of the current CU are calculated according to v₂ , v₃ and v₄.

Constructed affine candidate means the candidate is constructed by combining the neighbouring translational motion information of each control point. The motion information for the control points is derived from the specified spatial neighbours and temporal neighbour for a current block 1010 as shown in FIG. 10 . CPMV_(k) (k=1, 2, 3, 4) represents the k-th control point. For CPMV₁, the B2−>B3−>A2 blocks are checked and the MV of the first available block is used. For CPMV₂, the B1−>B0 blocks are checked and for CPMV₃, the A1->A0 blocks are checked. For TMVP is used as CPMV₄ if it's available.

After MVs of four control points are attained, affine merge candidates are constructed based on the motion information. The following combinations of control point MVs are used to construct in order:

{CPMV₁, CPMV₂, CPMV₃}, {CPMV₁, CPMV₂}, {CPMV₄}, {CPMV₁, CPMV₃, CPMV₄},

{CPMV₂, CPMV₃, CPMV₄}, {CPMV₁, CPMV₂}, {CPMV₁, CPMV₃}

The combination of 3 CPMVs constructs a 6-parameter affine merge candidate and the combination of 2 CPMVs constructs a 4-parameter affine merge candidate. To avoid motion scaling process, if the reference indices of control points are different, the related combination of control point MVs is discarded.

After inherited affine merge candidates and constructed affine merge candidate are checked, if the list is still not full, zero MVs are inserted to the end of the list.

Affine AMVP Prediction

Affine AMVP mode can be applied for CUs with both width and height larger than or equal to 16. An affine flag in the CU level is signalled in the bitstream to indicate whether affine AMVP mode is used and then another flag is signalled to indicate whether 4-parameter affine or 6-parameter affine is used. In this mode, the difference of the CPMVs of current CU and their predictors CPMVPs is signalled in the bitstream. The affine AVMP candidate list size is 2 and it is generated by using the following four types of CPVM candidate in order:

-   -   Inherited affine AMVP candidates that extrapolated from the         CPMVs of the neighbour CUs     -   Constructed affine AMVP candidates CPMVPs that are derived using         the translational MVs of the neighbour CUs     -   Translational MVs from neighbouring CUs     -   Zero MVs

The checking order of inherited affine AMVP candidates is the same as the checking order of inherited affine merge candidates. The only difference is that, for AVMP candidate, only the affine CU that has the same reference picture as current block is considered. No pruning process is applied when inserting an inherited affine motion predictor into the candidate list.

Constructed AMVP candidate is derived from the specified spatial neighbours shown in FIG. 10 . The same checking order is used as that in the affine merge candidate construction. In addition, the reference picture index of the neighbouring block is also checked. In the checking order, the first block that is inter coded and has the same reference picture as in current CUs is used. When the current CU is coded with the 4-parameter affine mode, and mv₀ and mv₁ are both availlalbe, they are added as one candidate in the affine AMVP list. When the current CU is coded with 6-parameter affine mode, and all three CPMVs are available, they are added as one candidate in the affine AMVP list. Otherwise, the constructed AMVP candidate is set as unavailable.

If the number of affine AMVP list candidates is still less than 2 after valid inherited affine AMVP candidates and constructed AMVP candidate are inserted, mv₀ , mv₁ and mv₂ will be added as the translational MVs in order to predict all control point MVs of the current CU, when available. Finally, zero MVs are used to fill the affine AMVP list if it is still not full.

Affine Motion Information Storage

In VVC, the CPMVs of affine CUs are stored in a separate buffer. The stored CPMVs are only used to generate the inherited CPMVPs in the affine merge mode and affine AMVP mode for the lately coded CUs. The subblock MVs derived from CPMVs are used for motion compensation, MV derivation of merge/AMVP list of translational MVs and de-blocking.

To avoid the picture line buffer for the additional CPMVs, affine motion data inheritance from the CUs of the above CTU is treated differently for the inheritance from the normal neighbouring CUs. If the candidate CU for affine motion data inheritance is in the above CTU line, the bottom-left and bottom-right subblock MVs in the line buffer instead of the CPMVs are used for the affine MVP derivation. In this way, the CPMVs are only stored in a local buffer. If the candidate CU is 6-parameter affine coded, the affine model is degraded to 4-parameter model. As shown in FIG. 11 , along the top CTU boundary, the bottom-left and bottom right subblock motion vectors of a CU are used for affine inheritance of the CUs in bottom CTUs. In FIG. 11 , line 1110 and line 1112 indicate the x and y coordinates of the picture with the origin (0,0) at the upper left corner. Legend 1120 shows the meaning of various motion vectors, where arrow 1122 represents the CPMVs for affine inheritance in the local buff, arrow 1124 represents sub-block vectors for MC/merge/skip/AMVP/deblocking/TMVPs in the local buffer and for affine inheritance in the line buffer, and arrow 1126 represents sub-block vectors for MC/merge/skip/AMVP/deblocking/TMVPs.

Adaptive Motion Vector Resolution (AMVR)

In HEVC, motion vector differences (MVDs) (between the motion vector and predicted motion vector of a CU) are signalled in units of quarter-luma-sample when use_integer_mv_flag is equal to 0 in the slice header. In VVC, a CU-level adaptive motion vector resolution (AMVR) scheme is introduced. AMVR allows MVD of the CU to be coded in different precisions. Dependent on the mode (normal AMVP mode or affine AVMP mode) for the current CU, the MVDs of the current CU can be adaptively selected as follows:

-   -   Normal AMVP mode: quarter-luma-sample, half-luma-sample,         integer-luma-sample or four-luma-sample.     -   Affine AMVP mode: quarter-luma-sample, integer-luma-sample or         1/16 luma-sample.

The CU-level MVD resolution indication is conditionally signalled if the current CU has at least one non-zero MVD component. If all MVD components (that is, both horizontal and vertical MVDs for reference list L0 and reference list L1) are zero, quarter-luma-sample MVD resolution is inferred.

For a CU that has at least one non-zero MVD component, a first flag is signalled to indicate whether quarter-luma-sample MVD precision is used for the CU. If the first flag is 0, no further signalling is needed and quarter-luma-sample MVD precision is used for the current CU. Otherwise, a second flag is signalled to indicate half-luma-sample or other MVD precisions (integer or four-luma sample) is used for a normal AMVP CU. In the case of half-luma-sample, a 6-tap interpolation filter instead of the default 8-tap interpolation filter is used for the half-luma sample position. Otherwise, a third flag is signalled to indicate whether integer-luma-sample or four-luma-sample MVD precision is used for the normal AMVP CU. In the case of affine AMVP CU, the second flag is used to indicate whether integer-luma-sample or 1/16 luma-sample MVD precision is used. In order to ensure the reconstructed MV has the intended precision (quarter-luma-sample, half-luma-sample, integer-luma-sample or four-luma-sample), the motion vector predictors for the CU will be rounded to the same precision as that of the MVD before being added together with the MVD. The motion vector predictors are rounded toward zero (that is, a negative motion vector predictor is rounded toward positive infinity and a positive motion vector predictor is rounded toward negative infinity).

The encoder determines the motion vector resolution for the current CU using RD check. To avoid always performing the CU-level RD check four times for each MVD resolution, the RD check of MVD precisions other than quarter-luma-sample is only invoked conditionally in VTM11. For the normal AVMP mode, the RD cost of quarter-luma-sample MVD precision and integer-luma sample MV precision is computed first. Then, the RD cost of integer-luma-sample MVD precision is compared to that of quarter-luma-sample MVD precision to decide whether it is necessary to further check the RD cost of four-luma-sample MVD precision. When the RD cost for the quarter-luma-sample MVD precision is much smaller than that of the integer-luma-sample MVD precision, the RD check of four-luma-sample MVD precision is skipped. Then, the check of half-luma-sample MVD precision is skipped if the RD cost of integer-luma-sample MVD precision is significantly larger than the best RD cost of previously tested MVD precisions. For the affine AMVP mode, if the affine inter mode is not selected after checking rate-distortion costs of affine merge/skip mode, merge/skip mode, quarter-luma-sample MVD precision normal AMVP mode and quarter-luma-sample MVD precision affine AMVP mode, then 1/16 luma-sample MV precision and 1-pel MV precision affine inter modes are not checked. Furthermore, affine parameters obtained in quarter-luma-sample MV precision affine inter mode are used as starting search point in 1/16 luma-sample and quarter-luma-sample MV precision affine inter modes.

Bi-Prediction with CU-level Weight (BCW)

In HEVC, the bi-prediction signal, P_(bi-pred) is generated by averaging two prediction signals, P₀ and P₁ obtained from two different reference pictures and/or using two different motion vectors. In VVC, the bi-prediction mode is extended beyond simple averaging to allow weighted averaging of the two prediction signals.

=

□

+

+□5

□  (3)

Five weights are allowed in the weighted averaging bi-prediction, w ∈{−2, 3, 4, 5,10}. For each bi-predicted CU, the weight w is determined in one of two ways: 1) for a non-merge CU, the weight index is signalled after the motion vector difference; 2) for a merge CU, the weight index is inferred from neighbouring blocks based on the merge candidate index. BCW is only applied to CUs with 256 or more luma samples (i.e., CU width times CU height is greater than or equal to 256). For low-delay pictures, all 5 weights are used. For non-low-delay pictures, only 3 weights (w E {3,4,5}) are used. At the encoder, fast search algorithms are applied to find the weight index without significantly increasing the encoder complexity. These algorithms are summarized as follows. The details are disclosed in the VTM software and document JVET-L0646 (Yu-Chi Su, et. al., “CE4-related: Generalized bi-prediction improvements combined from JVET-L0197 and JVET-L0296”, Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29, 12th Meeting: Macao, CN, 3-12 Oct. 2018, Document: JVET-L0646).

-   -   When combined with AMVR, unequal weights are only conditionally         checked for 1-pel and 4-pel motion vector precisions if the         current picture is a low-delay picture.     -   When combined with affine, affine ME will be performed for         unequal weights if and only if the affine mode is selected as         the current best mode.     -   When the two reference pictures in bi-prediction are the same,         unequal weights are only conditionally checked.     -   Unequal weights are not searched when certain conditions are         met, depending on the POC distance between current picture and         its reference pictures, the coding QP, and the temporal level.

The BCW weight index is coded using one context coded bin followed by bypass coded bins. The first context coded bin indicates if equal weight is used; and if unequal weight is used, additional bins are signalled using bypass coding to indicate which unequal weight is used.

Weighted prediction (WP) is a coding tool supported by the H.264/AVC and HEVC standards to efficiently code video content with fading. Support for WP is also added into the VVC standard. WP allows weighting parameters (weight and offset) to be signalled for each reference picture in each of the reference picture lists L0 and L1. Then, during motion compensation, the weight(s) and offset(s) of the corresponding reference picture(s) are applied. WP and BCW are designed for different types of video content. In order to avoid interactions between WP and BCW, which will complicate VVC decoder design, if a CU uses WP, then the BCW weight index is not signalled, and weight w is inferred to be 4 (i.e. equal weight is applied). For a merge CU, the weight index is inferred from neighbouring blocks based on the merge candidate index. This can be applied to both the normal merge mode and inherited affine merge mode. For the constructed affine merge mode, the affine motion information is constructed based on the motion information of up to 3 blocks. The BCW index for a CU using the constructed affine merge mode is simply set equal to the BCW index of the first control point MV.

In VVC, CIIP and BCW cannot be jointly applied for a CU. When a CU is coded with CIIP mode, the BCW index of the current CU is set to 2, (i.e., w=4 for equal weight). Equal Weight implies the default value for the BCW index.

Combined Inter and Intra Prediction (CIIP)

In VVC, when a CU is coded in merge mode, if the CU contains at least 64 luma samples (that is, CU width times CU height is equal to or larger than 64), and if both CU width and CU height are less than 128 luma samples, an additional flag is signalled to indicate if the combined inter/intra prediction (CIIP) mode is applied to the current CU. As its name indicates, the CIIP prediction combines an inter prediction signal with an intra prediction signal. The inter prediction signal in the CIIP mode _(Pinter) is derived using the same inter prediction process applied to regular merge mode; and the intra prediction signal _(1ntra) is derived following the regular intra prediction process with the planar mode. Then, the intra and inter prediction signals are combined using weighted averaging, where the weight value wt is calculated depending on the coding modes of the top and left neighbouring blocks (as shown in FIG. 12 ) of current CU 1210 as follows:

-   -   If the top neighbour is available and intra coded, then set         isIntraTop to 1, otherwise set isIntraTop to 0;     -   If the left neighbour is available and intra coded, then set         isIntraLeft to 1, otherwise set isIntraLeft to 0;     -   If (isIntraLeft+isIntraTop) is equal to 2, then wt is set to 3;     -   Otherwise, if (isIntraLeft+isIntraTop) is equal to 1, then wt is         set to 2;     -   Otherwise, set wt to 1.

The CIIP prediction is formed as follows:

P_(CHP)=((4-wt)*P_(inter)+wt*P_(intra)+2)»2   (4)

CCLM (Cross Component Linear Model)

The main idea behind CCLM mode (sometimes abbreviated as LM mode) is that some correlation often exists among colour components (e.g., Y/Cb/Cr, YUV and RGB) of colour pictures. These colours may be referred as first colour, second colour and third colour in this disclosure. CCLM technique exploits the correlation by predicting the chroma components of a block from the collocated reconstructed luma samples by linear models whose parameters are derived from already reconstructed luma and chroma samples that are adjacent to the block.

In VVC, the CCLM mode makes use of inter-channel dependencies by predicting the chroma samples from reconstructed luma samples. This prediction is carried out using a linear model in the form

P(i,j)=a·rec′_(L)(i,j)+b.   (5)

Here, P (i,) represents the predicted chroma samples in a CU and rec′_(L)(i, j) represents the reconstructed luma samples of the same CU which are down-sampled for the case of non-4:4:4 colour format. The model parameters a and b are derived based on reconstructed neighbouring luma and chroma samples at both encoder and decoder side without explicit signalling.

Three CCLM modes, i.e., CCLM_LT, CCLM_L, and CCLM_T, are specified in VVC. These three modes differ with respect to the locations of the reference samples that are used for model parameter derivation. Samples only from the top boundary are involved in the CCLM_T mode and samples only from the left boundary are involved in the CCLM_L mode. In the CCLM_LT mode, samples from both the top boundary and the left boundary are used.

Overall, the prediction process of CCLM modes consists of three steps:

-   -   1) Down-sampling of the luma block and its neighbouring         reconstructed samples to match the size of corresponding chroma         block,     -   2) Model parameter derivation based on reconstructed         neighbouring samples, and     -   3) Applying the model equation (1) to generate the chroma intra         prediction samples.

Down-sampling of the Luma Component: To match the chroma sample locations for 4:2:0 or 4:2:2: colour format video sequences, two types of down-sampling filter can be applied to luma samples, both of which have a 2-to-1 down-sampling ratio in the horizontal and vertical directions. These two filters correspond to “type-0” and “type-2” 4:2:0 chroma format content, respectively and are aiven by

$\begin{matrix} {{f_{1} = \begin{pmatrix} 0 & 1 & 0 \\ 1 & 4 & 1 \\ 0 & 1 & 0 \end{pmatrix}},{f_{2} = {\begin{pmatrix} 1 & 2 & 1 \\ 1 & 2 & 1 \end{pmatrix}.}}} & (6) \end{matrix}$

Based on the SPS-level flag information, the 2-dimensional 6-tap (i.e., f₂) or 5-tap (i.e., f₁) filter is applied to the luma samples within the current block as well as its neighbouring luma samples. The SPS-level refers to Sequence Parameter Set level. An exception happens if the top line of the current block is a CTU boundary. In this case, the one-dimensional filter [1, 2,1]/4 is applied to the above neighboring luma samples in order to avoid the usage of more than one luma line above the CTU boundary.

Model Parameter Derivation Process: The model parameters a and b from eqn. (5) are derived based on reconstructed neighbouring luma and chroma samples at both encoder and decoder sides to avoid the need for any signalling overhead. In the initially adopted version of the CCLM mode, the linear minimum mean square error (LMMSE) estimator was used for derivation of the parameters. In the final design, however, only four samples are involved to reduce the computational complexity. FIG. 13 shows the relative sample locations of M×N chroma block 1310, the corresponding 2M×2N luma block 1320 and their neighbouring samples (shown as filled circles and triangles) of “type-0” content.

In the example of FIG. 13 , the four samples used in the CCLM_LT mode are shown, which are marked by triangular shape. They are located at the positions of M/4 and M·3/4 at the top boundary and at the positions of N/4 and N·3/4 at the left boundary. In CCLM_T and CCLM_L modes, the top and left boundary are extended to a size of (M+N) samples, and the four samples used for the model parameter derivation are located at the positions (M+N)/8, (M+N)·3/8, (M+N)·5/8 , and (M+N)·7/8.

Once the four samples are selected, four comparison operations are used to determine the two smallest and the two largest luma sample values among them. Let X_(l) denote the average of the two largest luma sample values and let X_(S) denote the average of the two smallest luma sample values. Similarly, let Y_(l) and Y_(S) denote the averages of the corresponding chroma sample values. Then, the linear model parameters are obtained according to the following equation:

$\begin{matrix} {a = \frac{Y_{l} - Y_{s}}{X_{l} - X_{s}}} & (7) \end{matrix}$ b = Y_(s − a) ⋅ X_(s).

In this equation, the division operation to calculate the parameter a is implemented with a look-up table. To reduce the memory required for storing this table, the diff value, which is the difference between the maximum and minimum values, and the parameter a are expressed by an exponential notation. Here, the value of cliff is approximated with a 4-bit significant part and an exponent. Consequently, the table for 1/diff only consists of 16 elements. This has the benefit of both reducing the complexity of the calculation and decreasing the memory size required for storing the tables.

MMLM Overview

As indicated by the name, the original CCLM mode employs one linear model for predicting the chroma samples from the luma samples for the whole CU, while in MMLM (Multiple Model CCLM), there can be two models. In MMLM, neighbouring luma samples and neighbouring chroma samples of the current block are classified into two groups, each group is used as a training set to derive a linear model (i.e., particular α and β are derived for a particular group). Furthermore, the samples of the current luma block are also classified based on the same rule for the classification of neighbouring luma samples.

-   -   Threshold is calculated as the average value of the neighbouring         reconstructed luma samples. A neighbouring sample with         Rec′L[x,y]<=Threshold is classified into group 1; while a         neighbouring sample with Rec′L[x,y]>Threshold is classified into         group 2.     -   Correspondingly, a prediction for chroma is obtained using         linear models:

$\left\{ \begin{matrix} {{{Pred}_{C}\left\lbrack {x,y} \right\rbrack} = {{\alpha_{1} \times {{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack}} + \beta_{1}}} & {{{if}{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack}} \leq {Threshold}} \\ {{{Pred}_{C}\left\lbrack {x,y} \right\rbrack} = {{\alpha_{2} \times {{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack}} + \beta_{2}}} & {{{if}{{Rec}_{L}^{\prime}\left\lbrack {x,y} \right\rbrack}} > {Threshold}} \end{matrix} \right.$

Chroma Intra Mode Coding

For chroma intra mode coding, a total of 8 intra modes are allowed for chroma intra mode coding. Those modes include five traditional intra modes and three cross-component linear model modes (CCLM, LM_A, and LM_L). Chroma mode signalling and derivation process are shown in Table 3. Chroma mode coding directly depends on the intra prediction mode of the corresponding luma block. Since separate block partitioning structure for luma and chroma components is enabled in I slices, one chroma block may correspond to multiple luma blocks. Therefore, for Chroma DM (derived mode) mode, the intra prediction mode of the corresponding luma block covering the centre position of the current chroma block is directly inherited.

TABLE 3 Derivation of chroma prediction mode from luma mode when CCLM is enabled Chroma prediction Corresponding luma intra prediction mode mode 0 50 18 1 X (0 <= X <= 66 ) 0 66 0 0 0  0 1 50 66 50 50 50 2 18 18 66 18 18 3 1 1 1 66  1 4 0 50 18 1 X 5 81 81 81 81 81 6 82 82 82 82 82 7 83 83 83 83 83

A single binarization table is used regardless of the value of sps_cclm_enabled_flag as shown in Table 4.

TABLE 4 Unified binarization table for chroma prediction mode Value of Bin intra_chroma_pred_mode string 4 00 0 0100 1 0101 2 0110 3 0111 5 10 6 110 7 111

The first bin indicates whether it is a regular (i.e., 0) or LM mode (i.e., 1). If it is an LM mode, then the next bin indicates whether it is LM_CHROMA (i.e., 0) or not (i.e., 1). If it is not LM_CHROMA, next bin indicates whether it is LM_L (i.e., 0) or LM_A (i.e., 1). For this case, when sps_cclm_enabled_flag is 0, the first bin of the binarization table for the corresponding intra_chroma_pred_mode can be disregarded prior to the entropy coding. Or, in other words, the first bin is inferred to be 0 and hence not coded. This single binarization table is used for both sps_cclm_enabled_flag equal to 0 and 1 cases. The first two bins are context coded with its own context model, and the rest bins are bypass coded.

Multi-Hypothesis Prediction (MHP)

In the multi-hypothesis inter prediction mode (WET-M0425), one or more additional motion-compensated prediction signals are signalled, in addition to the conventional bi-prediction signal. The resulting overall prediction signal is obtained by sample-wise weighted superposition. With the bi-prediction signal p_(bi) and the first additional inter prediction signal/hypothesis h₃. the resulting prediction signal p₃ is obtained as follows:

p ₃=(1-α)p _(bi) +ah ₃   (8)

The weighting factor a is specified by the new syntax element add_hyp_weight_idx, according to the following mapping (Table 5):

TABLE 5 Mapping a to add_hyp_weight_idx add_hyp_weight_idx α 0   ¼ 1 −⅛

Analogously to above, more than one additional prediction signal can be used. The resulting overall prediction signal is accumulated iteratively with each additional prediction signal.

p _(n+1)=(1-α_(n+1))p _(n)+α_(n+1) h _(n+1)   (9)

The resulting overall prediction signal is obtained as the last p_(n) (i.e., the p_(n) having the largest index n). For example, up to two additional prediction signals can be used (i.e., n is limited to 2).

The motion parameters of each additional prediction hypothesis can be signalled either explicitly by specifying the reference index, the motion vector predictor index, and the motion vector difference, or implicitly by specifying a merge index. A separate multi-hypothesis merge flag distinguishes between these two signalling modes.

For inter AMVP mode, MHP is only applied if non-equal weight in BCW is selected in bi-prediction mode. Details of MHP for VVC can be found in JVET-W2025 (Muhammed Coban, et. al., “Algorithm description of Enhanced Compression Model 2 (ECM 2)”, Joint Video Experts Team (JVET) of ITU-T SG 16 WP 3 and ISO/IEC JTC 1/SC 29, 23rd Meeting, by teleconference, 7-16 July 2021, Document: JVET- W2025).

Combination of MHP and BDOF is possible, however the BDOF is only applied to the bi-prediction signal part of the prediction signal (i.e., the ordinary first two hypotheses).

BRIEF SUMMARY OF THE INVENTION

A method and apparatus for predictive coding are disclosed. According to the method, input data associated with a current block are received, where the input data comprise pixel data for the current block to be encoded at an encoder side or encoded data associated with the current block to be decoded at a decoder side. Combined prediction members are determined, where each of the combined prediction member comprises a weighted sum of a first prediction candidate and a second prediction candidate from a prediction candidate group using a target weighting selected from a weighting set. Boundary matching costs associated with the combined prediction members are determined, where each of the boundary matching costs is determined, for the combined prediction member with the target weighting, by using predicted samples of the current block based on the combined prediction member with the target weighting and neighbouring reconstructed samples of the current block. The current block is then encoded or decoded using a final combined prediction decided based on at least one of the boundary matching costs.

In one embodiment, a weighting value of the weight index is assigned according to a boundary matching cost associated with the combined prediction member with the target weighting, and wherein a smaller weighting value is assigned for a smaller boundary matching cost and a larger weighting value is assigned for a larger boundary matching cost.

In one embodiment, the weight index associated with the final combined prediction is determined implicitly at the encoder side and at the decoder side. The weight index determined implicitly corresponds to the combined prediction member with the target weighting resulting in a smallest boundary matching cost.

In one embodiment, the first prediction candidate and the second prediction candidate are from a prediction candidate group, and the prediction candidate group for the current block comprises a first bi-prediction candidate and a second bi-prediction candidate, and the first prediction candidate corresponds to the first bi-prediction candidate and the second prediction candidate corresponds to the second bi-prediction candidate.

In one embodiment, the first prediction candidate corresponds to an existing prediction and the second prediction candidate is from a prediction candidate group comprising one or more hypotheses of prediction. In one embodiment, said one or more hypotheses of prediction comprise at least two hypotheses of prediction and the final combined prediction is updated by setting the first prediction candidate to a previous final combined prediction and setting the second prediction candidate to a next hypothesis of prediction in the prediction candidate group. In one embodiment, the target weighting selected from the weighting set is determined implicitly according to the boundary matching costs.

In one embodiment, the predicted samples of the current block correspond to a subset of a prediction block for the current block. For example, the subset of the prediction block for the current block may comprise ni top lines and m 1 left lines of the prediction block, and the neighbouring reconstructed samples of the current block comprise n2 lines above the current block and m2 lines on a left side of the current block, and wherein n1, m1, n2 and m2 are integers greater than or equal to 0. In one example, nl and ml equal to 2, and n2 and m2 equal to 2. In another example, n1 and m1 equal to 2, and n2 and m2 equal to 1. In one embodiment, one or more syntaxes for n1, m1, n2 and m2 are signalled or parsed at a CU, CB, PU, PB, TU, TB, CTU, CTB, slice level, picture level, SPS (Sequence Parameter Set) level, PPS (Picture Parameter Set) level, or a combination thereof.

According to another method, input data associated with a current block are received, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or encoded data associated with the current block to be decoded at a decoder side. Prediction members associated with an existing prediction are determined, wherein each prediction member corresponds to one weighted sum of the existing prediction and one target combined prediction candidate from a group of combined prediction candidates, and wherein each combined prediction candidate corresponds to a combination of one target motion candidate and one target weighting for combining the existing prediction and said one target combined prediction candidate, said one target motion candidate is from a group of m motion candidates and said one target weighting is from a group of n weightings, and m and n are positive integers. Boundary matching costs associated with the prediction members are determined, wherein each boundary matching cost, for said each prediction member, is determined by using predicted samples of the current block based on said each prediction member and neighbouring reconstructed samples of the current block. The current block is encoded or decoded using a final prediction decided based on at least one of the boundary matching costs.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A illustrates an exemplary adaptive Inter/Intra video coding system incorporating loop processing.

FIG. 1B illustrates a corresponding decoder for the encoder in FIG. 1A.

FIG. 2 illustrates the neighbouring blocks used for deriving spatial merge candidates for VVC.

FIG. 3 illustrates the possible candidate pairs considered for redundancy check in

VVC.

FIG. 4 illustrates an example of temporal candidate derivation, where a scaled motion vector is derived according to POC (Picture Order Count) distances.

FIG. 5 illustrates the position for the temporal candidate selected between candidates C₀ and C₁.

FIG. 6 illustrates the distance offsets from a starting MV in the horizontal and vertical directions according to Merge Mode with MVD (MMVD).

FIG. 7A illustrates an example of the affine motion field of a block described by motion information of two control point (4-parameter).

FIG. 7B illustrates an example of the affine motion field of a block described by motion information of three control point motion vectors (6-parameter).

FIG. 8 illustrates an example of block based affine transform prediction, where the motion vector of each 4×4 luma subblock is derived from the control-point MVs.

FIG. 9 illustrates an example of derivation for inherited affine candidates based on control-point MVs of a neighbouring block.

FIG. 10 illustrates an example of affine candidate construction by combining the translational motion information of each control point from spatial neighbours and temporal.

FIG. 11 illustrates an example of affine motion information storage for motion information inheritance.

FIG. 12 illustrates an example of the weight value derivation for Combined Inter and Intra Prediction (CIIP) according to the coding modes of the top and left neighbouring blocks.

FIG. 13 illustrates an example of model parameter derivation for CCLM (Cross Component Linear Model) using neighbouring chroma samples and neighbouring luma samples.

FIG. 14 illustrates an example of boundary samples and neighbouring samples used to derive the boundary matching cost for a candidate mode.

FIG. 15 illustrates an example multiple hypotheses of prediction, where the multiple hypotheses of prediction include an existing hypothesis and two hypotheses of prediction h₁ and prediction h_(z).

FIG. 16 illustrates a flowchart of an exemplary video coding system that utilizes multiple hypotheses of prediction according to an embodiment of the present invention.

FIG. 17 illustrates a flowchart of another exemplary video coding system that utilizes multiple hypotheses of prediction according to an embodiment of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

It will be readily understood that the components of the present invention, as generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following more detailed description of the embodiments of the systems and methods of the present invention, as represented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. References throughout this specification to “one embodiment,” “an embodiment,” or similar language mean that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. Thus, appearances of the phrases “in one embodiment” or “in an embodiment” in various places throughout this specification are not necessarily all referring to the same embodiment.

Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. One skilled in the relevant art will recognize, however, that the invention can be practiced without one or more of the specific details, or with other methods, components, etc. In other instances, well-known structures, or operations are not shown or described in detail to avoid obscuring aspects of the invention. The illustrated embodiments of the invention will be best understood by reference to the drawings, wherein like parts are designated by like numerals throughout. The following description is intended only by way of example, and simply illustrates certain selected embodiments of apparatus and methods that are consistent with the invention as claimed herein.

With improvement of video coding, more coding tools are developed. However, the coding gain for the new coding tools is not additive. The possible reasons are that

-   -   Considering the syntax overhead, not all new coding modes can be         candidate modes for a block.     -   With increase of candidate modes for a block, longer codewords         are required for indicating a coding mode from multiple         candidate modes.

Take merge mode as an example. Compared to HEVC, new merge candidates such as pair-wise average merge candidates, HMVP merge candidates, etc., are proposed to add into the merge candidate list. As mentioned earlier, an index of best merge candidate is encoded/decoded to indicate the selected merge candidate for the current block. However,

-   -   The number of merge candidates in a merge candidate list is         limited to a pre-defined number, so not all of merge candidates         can be added into the merge candidate list.     -   If the number of merge candidates in a merge candidate list         increases, codeword length of the index of best merge candidate         becomes longer.

Therefore, a scheme is proposed to adaptively reorder the candidate modes. The general rule is shown below.

-   -   Calculate costs for each candidate mode, which can be (but not         limited to) merge candidates and/or can be extended to candidate         modes for any other tools     -   Next, decide the priority order of those candidate modes         according to the costs.         -   In one embodiment, those candidate modes with smaller costs             get higher priority.         -   In another embodiment, those candidate modes with smaller             costs get lower priority.     -   Next, the candidate modes are reordered depending on the         priority order.         -   The index with a smaller value refers to the candidate mode             with a higher priority.         -   In other words, the index refers to the candidate mode after             reordering.             -   Originally, the value of index refers to the index of                 candidate mode.             -   After applying the proposed reordering scheme, the value                 of index refers to the reordered index of candidate                 mode.

In another embodiment, for those candidate modes with higher priority, shorter codewords are used for encoding/decoding. In another embodiment, for the candidate mode with the highest priority, it is implicitly set as the coding mode for the current block. In this invention, the scheme to decide the priority order includes boundary matching. For each candidate mode, a boundary matching cost is calculated. The priority order depends on the boundary matching costs for those candidate modes.

Boundary Matching Cost for a Candidate Mode

A boundary matching cost for a candidate mode refers to the discontinuity measurement (including top boundary matching and/or left boundary matching) by using the current prediction (the predicted samples within the current block 1410 shown as a thick box in FIG. 14 ) generated from the candidate mode and the neighbouring reconstruction (the reconstructed samples within one or more neighbouring blocks). For example, the boundary matching cost for a candidate mode means the discontinuity between the current prediction and the neighbouring reconstruction. Top boundary matching means the comparison between the current top predicted samples and the neighbouring top reconstructed samples 1420, and left boundary matching means the comparison between the current left predicted samples and the neighbouring left reconstructed samples 1430.

In one embodiment, a pre-defined subset of the current prediction is used to calculate the boundary matching cost. n1 line(s) of top boundary within the current block and/or ml line(s) of left boundary within the current block are used, where n1 and ml are integers greater than or equal to 0. Moreover, n2 line(s) of top neighbouring reconstruction and/or m2 line(s) of left neighbouring reconstruction are used, where n2 and m2 are integers greater than or equal to 0.

Here is an example of calculating a boundary matching cost for n1=2, m1=2, n2=2, and m2=2.

$\begin{matrix} {{cost} = {{\sum}_{x = o}^{{block}{width}}\left( {❘{{a*{pred}_{x,0}} - {b*{pred}_{x,1}} - {c*{reco}_{x,{- 1}}}}❘} \right.}} \\ \left. {+ {❘{{d*{reco}_{x,{- 1}}} - {e*{pred}_{x,0}} - {f*{reco}_{x,{- 2}}}}❘}} \right) \\ {{+ {\sum}_{y = o}^{{block}{height}}}\left( {❘{{{\mathcal{g}}*{pred}_{0,y}} - {h*{pred}_{1,y}} - {i*{reco}_{{- 1},y}}}❘} \right.} \\ \left. {+ {❘{{j*{reco}_{{- 1},y}} - {k*{pred}_{0,y}} - {l*{reco}_{{- 2},y}}}❘}} \right) \end{matrix}$

In the above equation, the weights (a, b, c, d, e, f g, h, i, j, k, l) can be any positive integers such as a=2, b−1, c=1,d=2, e=1,f−1, g=2, h=1,i=1,j=2, k=1, and l=1.

Here is another example of calculating a boundary matching cost for n1=2, m1=2, n2=1, and m2=1.

cost=Σ_(x=o) ^(block width)(|a*pred_(x,0)-b*pred_(x,1)-c*reco_(x,−1)|)+Σ_(7=o) ^(block heig)(|g*pred_(0,y)-h*pred_(1,y)-i*reco_(−1,y)|)

In the above equation, the weights (a, b, c, g, h, i) can be any positive integers such as a=2, b=1, c=1, g=2, h=1, and i=1.

Here is another example of calculating a boundary matching cost for n1=1, m1=1, n2=2, m2=2.

cost=Σ_(x=o) ^(block width)(|d*reco_(x,−1)-e*pred_(x,0)-f*reco_(x,2)|)+Σ_(y=o) ^(block height)(|j*reco_(−1,y)-k*pred_(0,y)-l*reco_(−2,y)|)

In the above equation, the weights (d, e, f, j, k, l) can be any positive integers such as d=2, e=1,f=1,j=2, k=1, l=1.

Here is another example of calculating a boundary matching cost for n1=1, m1=1, n2=1, m2=1)

cost=Σ_(x=o) ^(block width)|a*pred_(x,o)-c*reco_(x,−1)|+Σ_(y=o) ^(block height)|g*pred_(0,y)-i*reco_(−1,y)|

In the above equation, the weights (a, c, g,) can be any positive integers such as a=1, c=1, g=1, i=1.

Here is another example of calculating a boundary matching cost for n1=2, m1=1, n2=2, m2=1.

${cost} = {{\sum}_{x = o}^{{block}{width}}\left( {❘{{a*{pred}_{x,0}} - {b*{pred}_{x,1}} - {c*{reco}_{x,{- 1}}}}❘} \right.}$ +❘d * reco_(x, −1) − e * pred_(x, 0) − f * reco_(x, −2)❘) ${+ {\sum}_{y = o}^{{block}{height}}}\left( {❘{{{\mathcal{g}}*{pred}_{0,y}} - {i*{reco}_{{- 1},y}}}❘} \right)$

In the above equation, the weights (a, b, c, d, e, f, g, i) can be any positive integers such as a−2,b=1,c=1,d=2, e=1,f=1,g=1,i=1.

Here is another example of calculating a boundary matching cost for n1=1, m1=2, n2=1, m2=2.

${cost} = {{\sum}_{x = o}^{{block}{width}}\left( {❘{{a*{pred}_{x,0}} - {c*{reco}_{x,{- 1}}}}❘} \right)}$ ${+ {\sum}_{y = o}^{{block}{heigh}}}\left( {❘{{{\mathcal{g}}*{pred}_{0,y}} - {h*{pred}_{1,y}} - {i*{reco}_{{- 1},y}}}❘} \right.$ +❘j * reco_(−1, y) − k * pred_(0, y) − l * reco_(−2, y)❘)

In the above equation, the weights (a, c, g, h, i, j, k, l) can be any positive integers such as a=1, c=1, g=2, h=1, i=1,j=2, k=1, l=1.

The following examples for n1 and ml can also be applied to n2 and m2.

For another example, n1 can be any positive integer such as 1, 2, 3, 4, etc.

For another example, ml can be any positive integer such as 1, 2, 3, 4, etc.

For another example, n1 and/or ml vary with block width, height, or area.

-   -   According to one example, for a larger block (e.g.         area >threshold), a larger m1 is used.         -   Threshold=64, 128, or 256.         -   When area>threshold, m1 is increased to 2. (Originally, m1             is 1.)         -   When area>threshold, m1 is increased to 4. (Originally, m1             is 1 or 2.)     -   According to another example, for a taller block (e.g.         height>threshold * width), a larger m1 is used and/or a smaller         n1 is used.         -   Threshold=1, 2, or 4.         -   When height>threshold * width, m1is increased to 2.             (Originally, m1 is 1.)         -   When height>threshold * width, m1is increased to 4.             (Originally, m1 is 1 or 2.)     -   According to another example, for a larger block (e.g.         area >threshold), a larger n1 is used.         -   Threshold=64, 128, or 256.         -   When area>threshold, n1 is increased to 2. (Originally, n1             is 1.)         -   When area>threshold, n1 is increased to 4. (Originally, n1             is 1 or 2.)     -   According to another example, for a wider block (e.g.         width>threshold * height), a larger n1 is used and/or a smaller         m1 is used.         -   Threshold=1, 2, or 4.         -   When width>threshold * height, n1 is increased to 2.             (Originally, n1 is 1.)         -   When width>threshold * height, n1 is increased to 4.             (Originally, n1 is 1 or 2.)

For another example, nl and/or ml can be defined in the standard or depend on the signalling/parsing from the syntax at CU/CB, PU/PB, TU/TB, CTU/CTB, slice level, picture level, SPS (Sequence Parameter Set) level, and/or PPS (Picture Parameter Set) level.

In another embodiment, when the current block is located at the top boundary within a CTU row, top boundary matching is not used and/or only left boundary matching is used. (The neighbouring reconstructed samples across CTU rows are not used.)

In another embodiment, when the current block is located at the left boundary within a CTU, left boundary matching is not used and/or only top boundary matching is used.

In another embodiment, when the current block is taller (e.g. height>threshold * width), only left boundary matching is used.

In another embodiment, when the current block is wider (e.g. width>threshold * height), only top boundary matching is used.

In another embodiment, top-left neighbouring reconstructed samples can be used for boundary matching. For example, the boundary matching cost is added with the following term:

|reco_(−1, −1)-pred_(0,0)|.

Merge Candidates as Candidate Modes

The proposed scheme can be used to reorder merge candidates. Originally, the index of the best merge candidate refers to the order of merge candidates in the merge candidate list. With the proposed scheme, the index (index_best_merge) of the best merge candidate refers to the priority order based on boundary matching costs.

For example, assume that the merge candidate list consists of {cand0, cand1, cand2, cand3, cand4, cand5}. These prediction candidates are referred as a prediction candidate group in this disclosure.

Original case:

-   -   index_best_merge 0 refers to cand0     -   index_best_merge 1 refers to cand1     -   index_best_merge 2 refers to cand2

Proposed:

-   -   Calculate boundary matching costs {cost_cand0, cost cand1,         cost_cand2, } for each merge candidate         -   cost_cand0 is the boundary matching cost for cand0         -   cost_cand1 is the boundary matching cost for cand1         -   cost_cand2 is the boundary matching cost for cand2     -   Reorder {cand0, cand1, cand2, . . . } according to boundary         matching costs         -   In one example,             -   If                 cost_cand0 >cost_cand1>cost_cand2>cost_cand3>cost_cand4>cost_cand5,                 the reordered merge candidates are formed as {cand5,                 cand4, cand3, cand2, cand1, cand0}.                 -   After reordering,                 -     index_best_merge 0 refers to cand5 (The merge                     candidate with the smallest cost is signalled with                     the shortest codewords.)                 -     index_best_merge 1 refers to cand4                 -     index_best_merge 2 refers to cand3             -   Otherwise, if                 cost_cand0<cost_cand1<cost_cand2<cost_cand3<cost_cand4<cost_cand5,                 the order of the merge candidates is kept the same as                 the original.         -   In another example,             -   If                 cost_cand0<cost_cand1<cost_cand2<cost_cand3<cost_cand4<cost_cand5,                 the reordered merge candidates are formed as {cand5,                 cand4, cand3, cand2, cand1, cand0}.                 -   After reordering,                 -     index_best_merge 0 refers to cand5 (The merge                     candidate with the largest cost is signalled with                     the shortest codewords.)                 -     index_best_merge 1 refers to cand4                 -     index_best_merge 2 refers to cand3             -   Otherwise, if                 cost_cand0>cost_cand1>cost_cand2>cost_cand3>cost_cand4>cost_cand5,                 the order of the merge candidates is kept the same as                 the original.

In another embodiment, the index_best_merge with a smaller value is coded with a shorter length of codewords. For example, the index_best_merge is coded with truncated unary codewords.

In another embodiment, reordering is applied to a subset of merge candidate list.

-   -   For example, the subset refers to the original first n         candidates such as cand0, cand1 and cand2. Then,         index_best_merge 0/1/2 refers to the priority order based on         boundary matching and index_best_merge 3/4/5 refers to original         cand3, cand4 and cand5.     -   For another example, the subset refers to the original last n         candidates such as cand3, cand4 and cand5. Then,         index_best_merge 3/4/5 refers to the priority order based on         boundary matching and index_best_merge 0/1/2 refers to original         cand0, cand1 and cand2.     -   For another example, the subset refers to spatial merge         candidates.

In another embodiment, the best merge candidate is inferred to be the merge candidate with the smallest boundary matching cost among all merge candidates. Accordingly, index_best_merge doesn't need to be signalled/parsed by the encoder/decoder and can be inferred as 0.

In another embodiment, the best merge candidate is inferred to be the merge candidate with the largest boundary matching cost among all merge candidates. Accordingly, index_best_merge doesn't need to be signalled/parsed by the encoder/decoder and can be inferred as 0.

In another embodiment, the merge candidates in this section refers to the merge candidates including one or more following candidates:

1) Spatial MVP from spatial neighbour CUs

2) Temporal MVP from collocated CUs

3) History-based MVP from an FIFO table

4) Pairwise average MVP

5) Zero MVs.

In another embodiment, the merge candidates in this section refers to the merge candidates for CIIP. The predicted samples within the current block are generated according to the CIIP process.

In another embodiment, the merge candidates in this section refers to the merge candidates for subblock merging candidates such as affine merge candidates. The predicted samples within the current block are generated according to the affine process.

BCW as Candidate Modes

The proposed scheme can be used to reorder BCW candidates to improve the syntax of bcw_idx. For example, one or more than one bi-prediction candidates are referred as a prediction candidate group and more than one target weightings, used to combine predictions from two prediction directions (e.g. list 0 and list1) for each bi-prediction candidate, are referred as a weighting set in this disclosure. For another example, more than one uni-prediction candidate is referred as a prediction candidate group and more than one target weightings, used to combine predictions for two uni-prediction candidates, are referred as a weighting set in this disclosure. For another example, one or more than one prediction candidates, being uni-prediction candidates and/or bi-prediction candidates, are referred as a prediction candidate group and more than one target weighting, used to combine predictions from two prediction candidates, are referred as a weighting set. The following is the syntax table of BCW in VVC standard.

if( sps_bcw_enabled_flag && inter_pred_idc[ x0 ][ y0 ] = = PRED_BI &&  luma_weight_l0_flag[ ref_idx_l0 [ x0 ] [ y0 ] ] = =  0 &&  luma_weight_l1_flag[ ref_idx_l1 [ x0 ] [ y0 ] ] = =  0 &&  chroma_weight_l0_flag[ ref_idx_l0 [ x0 ] [ y0 ] ] = =  0 &&  chroma_weight_l1_flag[ ref_idx_l1 [ x0 ][ y0 ] ] = =  0 &&  cbWidth * cbHeight >= 256 )  bcw_idx[ x0 ][y0 ] ae(v)

bcw_idx[ x0 ][ y0 ] specifies the weight index of bi-prediction with CU weights. The array indices x0, y0 specify the location (x0, y0) of the top-left luma sample of the considered coding block relative to the top-left luma sample of the picture.

An example of BCW as candidate modes is shown as follows:

Calculate boundary matching costs for each BCW candidate weight

In one embodiment, after reordering according to the costs,

-   -   The bcw_idx equal to 0 refers to the BCW candidate weight with         the smallest cost and bcw_idx equal to 4 refers to the BCW         candidate weight with the largest cost.     -   In an alternative way, bcw_idx is implicit and the BCW candidate         weight (which has a smallest cost) is used.

In another embodiment, after reordering according to the costs,

-   -   The bcw_idx equal to 0 refers to the BCW candidate weight with         the largest cost and bcw_idx equal to 4 refers to the BCW         candidate weight with the smallest cost.     -   In an alternative way, bcw_idx is implicit and the BCW candidate         weight (which has a largest cost) is used.

In the embodiment for BCW as Candidate Modes, the boundary matching costs are evaluated for a set of possible weights used for generating a final combined prediction. The prediction associated with each combined BCW prediction (i.e., a selected weighting) is referred to as a combined prediction member. The total number of combined prediction members corresponds to the total number of weightings. The bcw_idx is signalled/parsed or implicitly referred for the selected weight which will be used to generate the final combined prediction. The ordered boundary matching costs should result in a more efficient representation of bcw_idx, i.e., lower bit rate.

MHP as Candidate Modes

For a block with MHP applied, one or more hypotheses of prediction (i.e., prediction signal) are combined with the existing hypothesis of prediction to form the final (resulting) prediction of the current block. In other words, the final prediction is accumulated iteratively with each additional hypothesis of prediction signal. The example of accumulation is shown below.

p _(n+1)=(1-α_(n+1))p _(n)+α_(n+1) h _(n+1)

The resulting prediction signal is obtained as the last p_(n) (i.e., the p_(n) having the largest index n). p₀ is the first (existing) prediction of the current block. In the case of MHP as Candidate Modes, initially a weighted sum of an existing prediction and a hypothesis of prediction is formed as a combined prediction. When there are two or more hypotheses of prediction (i.e., n>1), the current combined prediction is formed as a weighted sum of a previous combined prediction and a next hypothesis of prediction. For example, if MHP is applied to a merge candidate, p₀ is indicated with the existing merge index. For another example, if MHP is applied to a inter AMVP candidate, p₀ is indicated with the existing inter AMVP index. The additional prediction is denoted as h and will be further combined with the previously-accumulated prediction by a weighting α.

Therefore, for each additional hypothesis of prediction, a weighting index is signalled/parsed to indicate the weighting and/or for each hypothesis of prediction an inter index is signalled/parsed to indicate the motion candidate (used for generating the predicted samples for this hypothesis). The syntax overhead of MHP becomes an issue in some cases. For example, when the number of additional hypotheses of prediction is increased, the syntax overhead of MHP becomes more. For another example, when the number of candidate weights for each additional hypothesis of prediction is increased, the syntax overhead of MHP becomes more. Therefore, the proposed reordering scheme is required for making the signalling of MHP weights and/or the signalling of motion candidates more efficient.

In one embodiment, boundary matching costs are calculated for each MHP candidate weight for each additional hypothesis of prediction. An example of the proposed process for a case with two candidate weights for a hypothesis of prediction is shown as follows:

-   -   Step 0: For an additional hypothesis of prediction, cost_w0 and         cost_w1 are calculated as the costs of the first and second         candidate weights, respectively.     -   Step 1: For the hypotheses of prediction, the candidate weights         are reordered depending on the costs.         -   In one sub-embodiment, the candidate weight with a smaller             cost gets a higher priority.             -   if cost_w0>cost_w1, the weight index 0 refers to wl and                 the weight index 1 refers to wO.             -   Otherwise, reordering is not used and the weight index 0                 and 1 refers to w0 and w1, as original.         -   In another sub-embodiment, the candidate weight with a             larger cost gets a higher priority.             -   if cost w0<cost w1, the weight index 0 refers to wl and                 the weight index 1 refers to w0.             -   Otherwise, reordering is not used and the weight index 0                 and 1 refers to w0 and w1, as original.         -   In another sub-embodiment, the candidate weight with a             smallest cost is used for the current additional hypothesis             of prediction. The weight index for the current additional             hypothesis of prediction is inferred in this case.         -   In another sub-embodiment, the weights for each hypothesis             or any subset of hypotheses are implicitly set according to             the costs. The weights can be scaled values of the costs or             scaled values of multiplicative inverse of the costs. For             example, if cost is equal to 2, multiplicative inverse of             the cost is equal to ½.         -   In another sub-embodiment, the candidate weight with a             largest cost is used for the current additional hypothesis             of prediction. The weight index for the current additional             hypothesis of prediction is inferred in this case.     -   Repeat step 0 and 1 for each additional hypothesis of prediction         and get the meaning of each weight index for each additional         hypothesis of prediction.

In another embodiment, boundary matching costs are calculated for each MHP motion candidate. Take MHP for merge mode as an example in the following sub-embodiments. MHP can be applied to other inter modes such as inter AMVP and/or affine and when inter AMVP or affine is used, “merge” in the following example is replaced with the naming of that inter mode.

In one sub-embodiment, the boundary matching costs for each motion candidate are calculated. For example, the candidate modes include cand0 to cand4. Originally, the index 0 (shorter codewords) refers to cand0 and the index 4 (longer codewords) refers to cand4. With the proposed method, the meaning of index follows the priority. If the priority order (based on the boundary matching costs) specifies that cand4 has the highest priority, the index 0 is mapped to cand4.

In another sub-embodiment, the boundary matching costs for each motion candidate are calculated. For example, the candidate modes include cand0 to cand4. Originally, the index 0 (shorter codewords) refers to cand0 and the index 4 (longer codewords) refers to cand4. With the proposed method, the meaning of index follows the priority. If the priority order (based on the boundary matching costs) specifies that cand4 has the highest priority, the index is not signalled/parsed and the selected motion candidate is inferred as the one with highest priority.

In another sub-embodiment, for each hypothesis, the current prediction (used in calculating boundary matching cost) for a motion candidate is the motion compensation result generated by that motion candidate.

An example of combining the above two sub-embodiments is shown below. For example, if the number of addition hypothesis is equal to 2, the first three motion candidates with the higher priority are used to form the resulting prediction of the current MHP block. For another example, if the number of addition hypothesis is equal to 2, the existing hypothesis is kept as original, the two motion candidates with the higher priority are used to form the prediction of additional hypotheses, and the resulting prediction is formed by the existing and additional hypothesis.

In another sub-embodiment, the current prediction (used in calculating boundary matching cost) for a motion candidate is the combined prediction (i.e., the weighted average of the prediction from a motion candidate and the existing prediction (p₀)). Weight is indicated by a signalled/parsed weight index.

In another sub-embodiment, for each hypothesis, the current prediction (used in calculating boundary matching cost) for a motion candidate is the combined prediction (the weighted average of the prediction from a motion candidate and the previously accumulated prediction). Weight is indicated by a signalled/parsed weight index. An example is shown in FIG. 15 , where prediction p₀ 1510 corresponds to an existing hypothesis, prediction h₁ 1520 and prediction h₂ 1530 correspond to additional hypotheses. When applying the proposed methods to reorder the signalling of motion candidates for h₂ and there are 4 motion candidates (including cand0 to cand3) for h₂,

-   -   The cost for candn is calculated as the weighted average of p₀         prediction, h₁ prediction, and the prediction from candn     -   That is,         -   For h₂, current prediction for candidate 0=weighted average             of (p₀ prediction, prediction of h₁, prediction from             candidate 0)         -   For h₂, current prediction for candidate 1=weighted average             of (p₀ prediction, prediction of h₁, prediction from             candidate 1)

When applying the proposed methods to reorder the signalling of motion candidates for h₁ and there are 4 motion candidates (including cand0 to cand3) for h₁,

-   -   For h₁, current prediction for candidate 0=weighted average of         (prediction of p₀, prediction from candidate 0)     -   For h₁, current prediction for candidate 1=weighted average of         (prediction of po, prediction from candidate 1)

In another embodiment, boundary matching costs are calculated for each MHP combination (motion candidate and weight) for each hypothesis of prediction. Take MHP for merge mode as an example in the following sub-embodiments, MHP can be applied to other inter modes such as inter AMVP and/or affine. When inter AMVP or affine is used, “merge” in the following example is replaced with the naming of that inter mode.

In one sub-embodiment, one combination refers to a motion candidate and a weight. If there are m motion candidates and n weights for each motion candidate, the number of combinations is m*n.

In another sub-embodiment, the current prediction (used in calculating boundary matching cost) for a combination is the combined prediction (the weighted average of the prediction from a motion candidate and the existing prediction (p₀)). With this method, the merge index and the weights for indicating the additional hypotheses of prediction are jointly decided. For example, the combination with the highest priority is the selected MHP combination. There is no need to signal/parse the merge index and the weight for indicating the additional hypotheses of prediction. In another example, a joint index is signalled/parsed to decide the MHP combination. The number of addition hypotheses can be fixed in this sub-embodiment.

In another embodiment, boundary matching costs are calculated for each MHP motion candidate. Take MHP for merge mode as an example in the following, MHP can be applied to other inter modes such as inter AMVP and/or affine. When inter AMVP or affine is used, “merge” in the following is replaced with the naming of that inter mode. Accordingly,

-   -   The merge index (which is used to indicate a motion candidate         for each hypothesis) is inferred.         -   For example, depending on the order of merge candidates in             the merge candidate list             -   Merge cand0 for hypothesis 0, merge cand1 for hypothesis                 1, . . .         -   For another example, depending on the costs.             -   Merge candidate with a smaller cost is used first.         -   For another example, depending on the predefined number of             merge candidates             -   If the number of hypotheses is 4, use 4 merge candidates                 from the merge candidate list to be the motion candidate                 for each hypothesis                 -   ✓ The first 4 merge candidates are used, or                 -   ✓ Any 4 merge candidates from the merge candidate                     list are used.     -   The weights (which are used to combine hypotheses of prediction)         are implicit depending on the costs.     -   MHP prediction is formed by         (weight0)*(hypothesis0)+(weight1)*(hypothesis         1)+(weight2)*(hypothesis2)+. . .

In one sub-embodiment, a fixed number of hypotheses of prediction is used. In other words, blend a fixed number of hypotheses and use the matching cost to derive weights implicitly.

In another sub-embodiment, the weight for the motion candidate (or the hypothesis) with higher priority is larger than the weight for the motion candidate with lower priority.

In another sub-embodiment, the current prediction (used in calculating boundary matching cost) for a motion candidate is the motion compensation result generated by that motion candidate.

In another sub-embodiment, the first n motion candidates in the merge candidate list are used for generating the hypotheses of predictions. With this proposed method, no merge index is signalled for MHP.

In another sub-embodiment, all motions candidates in the merge candidate list are used for generating the hypotheses of predictions. Weights can decide whether a motion candidate is useful. If its weight is zero, this motion candidate is actually not used. With this proposed method, no merge index is signalled for MHP.

In another sub-embodiment, the weight for the motion candidate with higher priority is larger than the weight for the motion candidate with lower priority.

For example, the weights follow the ratios of costs for different motions candidates. If there are two motion candidates and cost_cand0=2* cost_cand1, weight_cand0=2 * weight_cand1 or weight_cand0=1/2 * weight_cand1.

For another example, the cost for each motion candidate is normalized to an interval [MIN_VALUE, MAX_VALUE] first. The MAX_VALUE is pre-defined such as number of hypotheses of prediction. The MIN_VALUE is pre-defined such as 0. For example, (MAX_VALUE-the normalized costs) can be the weights for motion candidates or the normalized costs can be the weights for motion candidates.

For another example, the weights are scaled values of the costs or scaled values of multiplicative inverse of the costs. For example, if cost is equal to 2, multiplicative inverse of the cost is equal to ½.

-   -   Scaled value means a scaling factor * the original value.     -   If scaling factor =1, no scale.

In another sub-embodiment, the weight and merge index are implicit with the proposed method.

The generation of current prediction for this method can reference any other proposed methods in this invention.

In another embodiment, the proposed scheme is applied to a subset of all additional hypotheses of prediction. In other words, the above steps 0 and 1 are repeated for the subset of all additional hypotheses of prediction. For example, only candidate weights of the first additional hypothesis of prediction, which is combined with the existing hypothesis of prediction, are reordered with the proposed scheme.

In one sub-embodiment, the subset is pre-defined in the standard.

In another sub-embodiment, the subset depends on the current block width, height, or area. For example, for a block with the block area larger (or smaller) than a threshold, the subset includes more hypotheses of prediction.

In another sub-embodiment, the reordering results from the subset can be reused for the remaining additional hypotheses of prediction. For example,

-   -   Based on the reordering results from the first hypothesis of         prediction, the weight indices 0 and 1 refer to w1 and w0,         respectively.     -   For the following hypotheses of prediction, the weight indices 0         and 1 also refer to w1 and w0, respectively.

In another embodiment, the proposed scheme is applied to a subset of all candidate weights for an additional hypothesis of prediction. In other words, the above steps 0 and 1 are repeated for the subset of all candidate weights for an additional hypothesis of prediction. Take the number of candidate weights (for an additional hypothesis of prediction) equal to 4 as an example.

-   -   For an additional hypothesis of prediction, only the first (or         last) two candidate weights are reordered with the proposed         scheme.

In one sub-embodiment, the subset is pre-defined in the standard.

In another sub-embodiment, the subset depends on the current block width, height, or area. For example, for a block with the block area larger (or smaller) than a threshold, the subset includes more candidate weights.

In another embodiment, a hypothesis of prediction can be the prediction signal from an uni-prediction or bi-prediction motion compensation result.

The proposed reordering scheme for different tools (not limited to those tools in the following example) can be unified. For example, the proposed reordering scheme for MHP, LM, BCW, MMVD, and/or merge candidates is unified with the same rule of calculating boundary matching costs.

The proposed methods in this invention can be enabled and/or disabled according to implicit rules (e.g. block width, height, or area) or according to explicit rules (e.g. syntax on block, slice, picture, SPS, or PPS level). For example, the proposed reordering is applied when the block area is smaller than a threshold.

The term “block” in this invention can refer to TU/TB, CU/CB, PU/PB, or

CTU/CTB.

The term “LM” in this invention can be viewed as one kind of CCLM/MMLM modes or any other extension/variation of CCLM (e.g. the proposed CCLM extension/variation in this invention).

The proposed methods (for CCLM) in this invention can be used for any other LM modes.

Any combination of the proposed methods in this invention can be applied.

Any of the foregoing proposed methods can be implemented in encoders and/or decoders. For example, any of the proposed methods can be implemented in an intra/inter coding module of an encoder (e.g. Inter Pred. 112 in FIG. 1A), a motion compensation module (e.g., MC 152 in FIG. 1B), a merge candidate derivation module of a decoder. Alternatively, any of the proposed methods can be implemented as a circuit coupled to the intra/inter coding module of an encoder and/or motion compensation module, a merge candidate derivation module of the decoder.

FIG. 16 illustrates a flowchart of an exemplary video coding system that utilizes multiple hypotheses of prediction according to an embodiment of the present invention. The steps shown in the flowchart may be implemented as program codes executable on one or more processors (e.g., one or more CPUs) at the encoder side. The steps shown in the flowchart may also be implemented based hardware such as one or more electronic devices or processors arranged to perform the steps in the flowchart. According to this method, input data associated with a current block are received in step 1610, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or encoded data associated with the current block to be decoded at a decoder side. Combined prediction members are determined in step 1620, wherein each of the combined prediction member comprises a weighted sum of a first prediction candidate and a second prediction candidate using a target weighting selected from a weighting set. Boundary matching costs associated with the combined prediction members are determined in step 1630, wherein each of the boundary matching costs is determined, for the combined prediction member with the target weighting, by using predicted samples of the current block based on the combined prediction member with the target weighting and neighbouring reconstructed samples of the current block. The current block is encoded or decoded using a final combined prediction decided based on at least one of the boundary matching costs in step 1640.

FIG. 17 illustrates a flowchart of another exemplary video coding system that utilizes multiple hypotheses of prediction according to an embodiment of the present invention. According to this method, input data associated with a current block are received in step 1710, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or encoded data associated with the current block to be decoded at a decoder side. Prediction members associated with an existing prediction are determined in step 1720, wherein each prediction member corresponds to one weighted sum of the existing prediction and one target combined prediction candidate from a group of combined prediction candidates, and wherein each combined prediction candidate corresponds to a combination of one target motion candidate and one target weighting for combining the existing prediction and said one target combined prediction candidate, said one target motion candidate is from a group of m motion candidates and said one target weighting is from a group of n weightings, and m and n are positive integers. Boundary matching costs associated with the prediction members are determined in step 1730, wherein each boundary matching cost, for said each prediction member, is determined by using predicted samples of the current block based on said each prediction member and neighbouring reconstructed samples of the current block. The current block is encoded or decoded using a final prediction decided based on at least one of the boundary matching costs in step 1740.

The flowcharts shown are intended to illustrate an example of video coding according to the present invention. A person skilled in the art may modify each step, re-arranges the steps, split a step, or combine steps to practice the present invention without departing from the spirit of the present invention. In the disclosure, specific syntax and semantics have been used to illustrate examples to implement embodiments of the present invention. A skilled person may practice the present invention by substituting the syntax and semantics with equivalent syntax and semantics without departing from the spirit of the present invention.

The above description is presented to enable a person of ordinary skill in the art to practice the present invention as provided in the context of a particular application and its requirement. Various modifications to the described embodiments will be apparent to those with skill in the art, and the general principles defined herein may be applied to other embodiments. Therefore, the present invention is not intended to be limited to the particular embodiments shown and described, but is to be accorded the widest scope consistent with the principles and novel features herein disclosed. In the above detailed description, various specific details are illustrated in order to provide a thorough understanding of the present invention. Nevertheless, it will be understood by those skilled in the art that the present invention may be practiced.

Embodiment of the present invention as described above may be implemented in various hardware, software codes, or a combination of both. For example, an embodiment of the present invention can be one or more circuit circuits integrated into a video compression chip or program code integrated into video compression software to perform the processing described herein. An embodiment of the present invention may also be program code to be executed on a Digital Signal Processor (DSP) to perform the processing described herein. The invention may also involve a number of functions to be performed by a computer processor, a digital signal processor, a microprocessor, or field programmable gate array (FPGA). These processors can be configured to perform particular tasks according to the invention, by executing machine-readable software code or firmware code that defines the particular methods embodied by the invention. The software code or firmware code may be developed in different programming languages and different formats or styles. The software code may also be compiled for different target platforms. However, different code formats, styles and languages of software codes and other means of configuring code to perform the tasks in accordance with the invention will not depart from the spirit and scope of the invention.

The invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described examples are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope. 

1. A method of predictive coding, the method comprising: receiving input data associated with a current block, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or encoded data associated with the current block to be decoded at a decoder side; determining combined prediction members, wherein each of the combined prediction member comprises a weighted sum of a first prediction candidate and a second prediction candidate using a target weighting selected from a weighting set; determining boundary matching costs associated with the combined prediction members, wherein each of the boundary matching costs is determined, for the combined prediction member with the target weighting, by using predicted samples of the current block based on the combined prediction member with the target weighting and neighbouring reconstructed samples of the current block; and encoding or decoding the current block using a final combined prediction decided based on at least one of the boundary matching costs.
 2. The method of claim 1, wherein a weight index is used to indicate the target weighting selected from the weighting set.
 3. The method of claim 2, wherein a weighting value of the weight index is assigned according to a boundary matching cost associated with the combined prediction member with the target weighting, and wherein a smaller weighting value is assigned for a smaller boundary matching cost and a larger weighting value is assigned for a larger boundary matching cost.
 4. The method of claim 2, wherein the weight index associated with the final combined prediction is signalled in a bitstream at the encoder side or parsed from the bitstream at the decoder side.
 5. The method of claim 2, wherein the weight index associated with the final combined prediction is determined implicitly at the encoder side and at the decoder side.
 6. The method of claim 5, wherein the weight index determined implicitly corresponds to the combined prediction member with the target weighting resulting in a smallest boundary matching cost.
 7. The method of claim 1, wherein the first prediction candidate and the second prediction candidate are from a prediction candidate group, and the prediction candidate group for the current block comprises a first bi-prediction candidate and a second bi-prediction candidate, and wherein the first prediction candidate corresponds to the first bi-prediction candidate and the second prediction candidate corresponds to the second bi-prediction candidate.
 8. The method of claim 1, wherein the first prediction candidate corresponds to an existing prediction and the second prediction candidate is from a prediction candidate group comprising one or more hypotheses of prediction.
 9. The method of claim 8, wherein said one or more hypotheses of prediction comprise at least two hypotheses of prediction and the final combined prediction is updated by setting the first prediction candidate to a previous final combined prediction and setting the second prediction candidate to a next hypothesis of prediction in the prediction candidate group.
 10. The method of claim 9, wherein the target weighting selected from the weighting set is determined implicitly according to the boundary matching costs.
 11. The method of claim 1, wherein the predicted samples of the current block correspond to a subset of a prediction block for the current block.
 12. The method of claim 11, wherein the subset of the prediction block for the current block comprises n1 top lines and m1 left lines of the prediction block, and the neighbouring reconstructed samples of the current block comprise n2 lines above the current block and m2 lines on a left side of the current block, and wherein nl, ml, n2 and m2 are integers greater than equal to
 0. 13. The method of claim 12, wherein n1 and m1 equal to 2, and n2 and m2 equal to
 2. 14. The method of claim 12, wherein n1 and ml equal to 2, and n2 and m2 equal to
 1. 15. The method of claim 12, wherein one or more syntaxes for n1, m1, n2 and m2 are signalled or parsed at a CU, CB, PU, PB, TU, TB, CTU, CTB, slice level, picture level, SPS (Sequence Parameter Set) level, PPS (Picture Parameter Set) level, or a combination thereof.
 16. An apparatus for predictive coding, the apparatus comprising one or more electronics or processors arranged to: receive input data associated with a current block, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or encoded data associated with the current block to be decoded at a decoder side; determine combined prediction members, wherein each of the combined prediction member comprises a weighted sum of a first prediction candidate and a second prediction candidate using a target weighting selected from a weighting set; determine boundary matching costs associated with the combined prediction members, wherein each of the boundary matching costs is determined, for the combined prediction member with the target weighting, by using predicted samples of the current block based on the combined prediction member with the target weighting and neighbouring reconstructed samples of the current block; and encode or decode the current block using a final combined prediction decided based on at least one of the boundary matching costs.
 17. A method of predictive coding, the method comprising: receiving input data associated with a current block, wherein the input data comprise pixel data for the current block to be encoded at an encoder side or encoded data associated with the current block to be decoded at a decoder side; determining prediction members associated with an existing prediction, wherein each prediction member corresponds to one weighted sum of the existing prediction and one target combined prediction candidate from a group of combined prediction candidates, and wherein each combined prediction candidate corresponds to a combination of one target motion candidate and one target weighting for combining the existing prediction and said one target combined prediction candidate, said one target motion candidate is from a group of m motion candidates and said one target weighting is from a group of n weightings, and m and n are positive integers; determining boundary matching costs associated with the prediction members, wherein each boundary matching cost, for said each prediction member, is determined by using predicted samples of the current block based on said each prediction member and neighbouring reconstructed samples of the current block; and encoding or decoding the current block using a final prediction decided based on at least one of the boundary matching costs.
 18. The method of claim 17, wherein a joint weighting and motion candidate index associated with said one target motion candidate and said one target weighting cif the final prediction is signalled in a bitstream at the encoder side or parsed from the bitstream at the decoder side.
 19. The method of claim 17, wherein a joint weighting and motion candidate index associated with said one target motion candidate and said one target weighting of the final prediction is determined implicitly. 